<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<html>
<head>
<%@ include file="common.jsp"%>
<link type="text/css" rel="stylesheet" href="<%=rootPath%>/css/manage/selectResult.css" />
<title><%=proName%>-日志权限</title>
<script type="text/javascript">
	//查询权限人员列表
	function select1(){
 		searchtForm.target="_self";
 		searchtForm.submit();
	}
	//删除选中的人员
    function deleteEmp(){
      	var url = deleteForm.action;
      	if(confirm("您确认删除已选中的人员的权限？")){
      		$.ajax({
      		  	url: url,
      		  	type: "POST",
      		  	data:$("#deleteForm").serialize(),
      		  	dataType: "text",
      		  	success: function( response ) {
      		  		var data=$.parseJSON(response);
      				if(data.state=="200"){
      					location.reload();
      				}else{
      					alert('fail',data.msg);
      				}
      		  	}
      		});
      	}
      }
	//进入添加页面
      function addEmp(){
      	var powerType = $("#powerType").val();
      	location.href = "<%=rootPath%>/workConPower/toAddPage.mge?powerType=" + powerType;
	}
</script>
</head>

<body>
	<jsp:include page="./menu.jsp"></jsp:include>
	<div id="body">
		<div id="navTop">
			<div class="bg_left"></div>
			<div class="bg_main"></div>
			<div class="bg_right"></div>
		</div>
		<div id="userManager">
			<table width="100%" cellpadding="0" cellspacing="0" border="0" class="maintable">
				<tr>
					<th align="left" valign="middle">
						<table cellpadding="0" cellspacing="0">
							<tr>
								<th><span id="search_icon" class="search_icon"></span></th>
								<th height="30px"><span style="margin-left: 2px;">查询条件</span></th>
							</tr>
						</table>
					</th>
				</tr>
				<tr>
					<td>
						<form id="searchtForm" method="get" name="searchtForm" action="<%=rootPath%>/workConPower/findEmpListByPowerType.mge" title=''>
							<table width="100%" cellpadding="0" cellspacing="0" border="0">
								<tr>
									<td align="left">
										<table cellpadding="0" cellspacing="0" border="0">
											<tr>
												<td width="100px" bgcolor="#DDDDDD"><span>权限类型：</span></td>
												<td width="5px"></td>
												<td>
													<select id="powerType" name="powerType" style="width: 182px">
														<option value="NC_CanViewUser" <c:if test="${powerType=='NC_CanViewUser'}">selected</c:if>>可以查看他人日志的用户</option>
														<option value="NC_CanReviewUser" <c:if test="${powerType=='NC_CanReviewUser'}">selected</c:if>>可以审阅他人日志的用户</option>
														<option value="NC_CanBeReviewUser" <c:if test="${powerType=='NC_CanBeReviewUser'}">selected</c:if>>可以被审阅的用户</option>
														<option value="HO_CanViewUser" <c:if test="${powerType=='HO_CanViewUser'}">selected</c:if>>总公司员工可以查看分公司日志的用户</option>
														<option value="HO_CanReviewUser" <c:if test="${powerType=='HO_CanReviewUser'}">selected</c:if>>总公司员工可以评论分公司日志的用户</option>
														<option value="HO_CanShareUser" <c:if test="${powerType=='HO_CanShareUser'}">selected</c:if>>可以分享他人日志的用户</option>
													</select>
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<th align="right">
										<input type="button" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="查 询" onclick="select1()" onmouseover="this.style.background='#FFF18B'" onmouseout="this.style.background='#F1EDD2'" />
										<input type="button" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="删  除" onclick="deleteEmp()" onmouseover="this.style.background='#FFF18B'" onmouseout="this.style.background='#F1EDD2'" />
										<input type="button" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false" value="添  加" onclick="addEmp()" onmouseout="this.style.background='#F1EDD2'" />
									</th>
								</tr>
							</table>
						</form>
					</td>
				</tr>
				<tr>
					<th align="left">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<th><span id="search_icon1" class="search_icon"></span></th>
								<th height="30px"><span style="margin-left: 2px;">查询结果</span></th>
							</tr>
						</table>
					</th>
				</tr>
				<tr>
					<td>
						<form id="deleteForm" method="post" name="deleteForm" action="<%=rootPath%>/workConPower/delete.mge" title=''>
							<table class="admintable" width="100%" style="margin: auto">
								<tr>
									<th class="adminth">选择</th>
									<th class="adminth">工号</th>
									<th class="adminth">姓名</th>
									<th class="adminth_dept">部门</th>
									<th class="adminth">职级</th>
									<th class="adminth">职级名称</th>
								</tr>
								<c:forEach items="${list}" var="user" varStatus="s">
									<tr style="background-color: <c:if test="${s.index%2==0 }">#F7F4D8</c:if><c:if test="${s.index%2!=0 }">#FFF</c:if>">
										<td align="center"><input type="checkbox" name="ids" value="${user.idNo }" /></td>
										<td align="center">${user.empId}</td>
										<td align="center">${user.emp_name}</td>
										<td align="center">${user.deptName}</td>
										<td align="center">${user.postId}</td>
										<td align="center">${user.posiName}</td>
									</tr>
								</c:forEach>
							</table>
						</form>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<jsp:include page="./footer.jsp"></jsp:include>
</body>
</html>
